//
//  RankingMenuCell.swift
//  SLQuickReader
//
//  Created by ALin on 2017/8/24.
//  Copyright © 2017年 ALin. All rights reserved.
//

import UIKit

class RankingMenuCell: UITableViewCell {
    var menu: String = ""{
        didSet{
            textLabel?.text = menu
            textLabel?.font = menu.characters.count > 3 ? UIFont.systemFont(ofSize: 12) : UIFont.systemFont(ofSize: 14)
        }
    }
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        textLabel?.textAlignment = .center
        backgroundColor = UIColor.groupTableViewBackground
        selectionStyle = .none
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
        if selected {
            print("xxxx");
        }
        backgroundColor = selected ? UIColor.white : UIColor.groupTableViewBackground
    }

}
